package com.kifas.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "tb_detail_pengiriman")
public class PengirimanDetailEntity implements Serializable {

	private static final long serialVersionUID = -8391258110306849124L;

	@Id
	@GeneratedValue
	@Column(name = "id_detail_pengiriman")
	private Long idDetailPengiriman;

	@ManyToOne
	@JoinColumn(name = "id_pengiriman", nullable = false)
	private PengirimanEntity pengiriman;

	@ManyToOne
	@JoinColumn(name = "id_barang", nullable = false)
	private BarangEntity barang;

	@ManyToOne
	@JoinColumn(name = "id_master_gudang", nullable = false)
	private GudangEntity gudang;

	private Integer qty;

	@Column(name = "sisa_kirim")
	private Integer sisaKirim;

	@Column(name = "bulan_kadaluarsa")
	private String bulanKadaluarsa;

	@Column(name = "created_by")
	private String createdBy;
	
	@Column(name = "created_date")
	@Temporal(TemporalType.DATE)
	private Date createdDate;

	public PengirimanDetailEntity() {
	}

	public PengirimanDetailEntity(Long idDetailPengiriman, PengirimanEntity pengiriman, BarangEntity barang, GudangEntity gudang, Integer qty,
			Integer sisaKirim, String bulanKadaluarsa, String createdBy, Date createdDate) {
		this.idDetailPengiriman = idDetailPengiriman;
		this.pengiriman = pengiriman;
		this.barang = barang;
		this.qty = qty;
		this.sisaKirim = sisaKirim;
		this.bulanKadaluarsa = bulanKadaluarsa;
		this.createdBy = createdBy;
		this.createdDate = createdDate;
	}

	public Long getIdDetailPengiriman() {
		return idDetailPengiriman;
	}

	public void setIdDetailPengiriman(Long idDetailPengiriman) {
		this.idDetailPengiriman = idDetailPengiriman;
	}

	public PengirimanEntity getPengiriman() {
		return pengiriman;
	}

	public void setPengiriman(PengirimanEntity pengiriman) {
		this.pengiriman = pengiriman;
	}

	public BarangEntity getBarang() {
		return barang;
	}

	public void setBarang(BarangEntity barang) {
		this.barang = barang;
	}

	public Integer getQty() {
		return qty;
	}

	public void setQty(Integer qty) {
		this.qty = qty;
	}

	public String getBulanKadaluarsa() {
		return bulanKadaluarsa;
	}

	public void setBulanKadaluarsa(String bulanKadaluarsa) {
		this.bulanKadaluarsa = bulanKadaluarsa;
	}

	public void setGudang(GudangEntity gudang) {
		this.gudang = gudang;
	}

	public GudangEntity getGudang() {
		return gudang;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setSisaKirim(Integer sisaKirim) {
		this.sisaKirim = sisaKirim;
	}

	public Integer getSisaKirim() {
		return sisaKirim;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getCreatedDate() {
		return createdDate;
	}
}
